//package com.wejoy.video.middle.station.api.controller.screen;/**
// * @Author 张文杰
// * @PackageName video-middle-station
// * @Package com.wejoy.video.middle.station.api.controller.screen
// * @Date 2022/11/28 4:09 PM
// * @Version 1.0
// */
//
//import com.alibaba.fastjson.JSONObject;
//import com.baidubce.http.HttpMethodName;
//import com.wejoy.video.middle.station.data.constant.BaiduEVSConstant;
//import com.wejoy.video.middle.station.data.constant.RedisKeys;
//import com.wejoy.video.middle.station.data.domain.PageResult;
//import com.wejoy.video.middle.station.data.domain.system.SysDept;
//import com.wejoy.video.middle.station.data.domain.system.SysDeptCamera;
//import com.wejoy.video.middle.station.data.domain.system.SysNotice;
//import com.wejoy.video.middle.station.data.domain.workorder.*;
//import com.wejoy.video.middle.station.data.enums.dict.EnumBigScreen;
//import com.wejoy.video.middle.station.data.enums.dict.EnumDeptType;
//import com.wejoy.video.middle.station.data.enums.dict.EnumWorkOrderStatus;
//import com.wejoy.video.middle.station.data.service.system.ISysDeptCameraService;
//import com.wejoy.video.middle.station.data.service.system.ISysDeptService;
//import com.wejoy.video.middle.station.data.service.workorder.*;
//import com.wejoy.video.middle.station.data.util.StringUtils;
//import com.wejoy.video.middle.station.data.util.WJAssert;
//import com.wejoy.video.middle.station.data.util.baiduevs.BaiduEVSRequestUtil;
//import com.wejoy.video.middle.station.data.util.baiduevs.BaiduRequestSignatureHaders;
//import com.wejoy.video.middle.station.data.util.baiduevs.HttpResult;
//import com.wejoy.video.middle.station.data.vo.RespJSON;
//import com.wejoy.video.middle.station.data.vo.api.*;
//import org.jetbrains.annotations.NotNull;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.util.CollectionUtils;
//import org.springframework.util.ObjectUtils;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * @BelongsProject: video-middle-station
// * @BelongsPackage: com.wejoy.video.middle.station.api.controller.screen
// * @Author: zhangwenjie
// * @CreateTime: 2022-11-28  16:09
// * @Description: 大屏所需接口
// * @Version: 1.0
// */
//@RestController
//@RequestMapping("/api")
//public class BigScreencontroller {
//
//    @Autowired
//    private IWorkOrderInfoService workOrderInfoService;
//
//    @Autowired
//    private IOrderAlarmAssortService orderAlarmAssortService;
//
//    @Autowired
//    private IOrderAlarmInfoService orderAlarmInfoService;
//
//    @Autowired
//    private ISysDeptService sysDeptService;
//    @Autowired
//    private IWorkOrderProcessService workOrderProcessService;
//    @Autowired
//    private IWorkOrderReviewService workOrderReviewService;
//    @Autowired
//    private ISysDeptCameraService sysDeptCameraService;
//    @Value("${qiniu.prefix}")
//    private String imagePrefix;
//    @Autowired
//    private BaiduEVSRequestUtil baiduEVSRequestUtil;
//    @Autowired
//    private IOrderPhotoLibService orderPhotoLibService;
//
//    @Autowired
//    private RedisTemplate redisTemplate;
//
////    /**
////     * 分页查询
////     *
////     * @param workOrderInfoReq workOrderInfoReq
////     * @return RespJSON
////     */
////    @PostMapping  ("/getOrderPageList")
////    public RespJSON getPageList(@RequestBody(required = false) WorkOrderInfo workOrderInfoReq) {
////        if(workOrderInfoReq.getOrderStatus()!=null&&workOrderInfoReq.getOrderStatus()==-1){
////            workOrderInfoReq.setSearchUndone(true);
////            workOrderInfoReq.setOrderStatus(null);
////        }
////        int count = workOrderInfoService.getCount(workOrderInfoReq);
////        List<WorkOrderInfo> list = new ArrayList<>();
////        if (count > 0) {
////            list = workOrderInfoService.getPageList(workOrderInfoReq).stream().peek(item ->{
////                WorkOrderProcess processWhere = new WorkOrderProcess();
////                item.setImageUrl(imagePrefix+item.getImageUrl());
////                processWhere.setOrderId(item.getId());
////                item.setProcessList(workOrderProcessService.getList(processWhere));
////                WorkOrderReview reviewWhere = new WorkOrderReview();
////                reviewWhere.setOrderId(item.getId());
////                OrderPhotoLib orderPhotoLib = new OrderPhotoLib();
////                orderPhotoLib.setOrderId(item.getId());
////                List<OrderPhotoLib> photoLibs = orderPhotoLibService.getList(orderPhotoLib);
////                for (OrderPhotoLib photoLib : photoLibs) {
////                    photoLib.setImageUrl(imagePrefix+photoLib.getImageUrl());
////                }
////                item.setPhotoLibs(photoLibs);
////                item.setReviewList(workOrderReviewService.getList(reviewWhere));
////            }).collect(Collectors.toList());
////        }
////        PageResult result = new PageResult(workOrderInfoReq.getPageNo(), workOrderInfoReq.getPageSize(), count, list);
////        return RespJSON.success(result);
////    }
//
//
////    /**
////     * 查询大屏需弹窗工单
////     *
////     * @return RespJSON
////     */
////    @GetMapping("/getReminderOrder/{type}")
////    public RespJSON getReminderOrder(@PathVariable Integer type) {
////        EnumBigScreen bigScreen = EnumBigScreen.getByCode(type);
////        if(ObjectUtils.isEmpty(bigScreen)){
////            return RespJSON.success();
////        }
////        String json=(String) redisTemplate.opsForList().rightPop(bigScreen.getValue());
////        if(StringUtils.isEmpty(json)){
////            return RespJSON.success();
////        }
////        WorkOrderInfo workOrderInfo = JSONObject.parseObject(json, WorkOrderInfo.class);
////        workOrderInfo.setImageUrl(imagePrefix+workOrderInfo.getImageUrl());
////        return RespJSON.success(workOrderInfo);
////    }
//
//    /**
//     * 报警数量查询
//     * @param workOrderInfoReq
//     * @return
//     */
//    @PostMapping ("/numberOfAlarms")
//    public RespJSON numberOfAlarms(@RequestBody(required = false) WorkOrderInfo workOrderInfoReq) {
//        AlarmsNumsVO vo = new AlarmsNumsVO();
//        workOrderInfoReq.setOrderStatus(EnumWorkOrderStatus.FINISHED.getCode());
//        vo.setFinished(workOrderInfoService.getCount(workOrderInfoReq));
//        workOrderInfoReq.setOrderStatus(null);
//        vo.setTheTotalNumber(workOrderInfoService.getCount(workOrderInfoReq));
//        workOrderInfoReq.setSearchUndone(true);
//        vo.setOrderReceived(workOrderInfoService.getCount(workOrderInfoReq));
//        workOrderInfoReq.setSearchUndone(false);
//        workOrderInfoReq.setOrderStatus(EnumWorkOrderStatus.AGENCY.getCode());
//        vo.setCurrentAlarm(workOrderInfoService.getCount(workOrderInfoReq));
//        return RespJSON.success(vo);
//    }
//
//    /**
//     * 业务场景报警统计
//     * @param workOrderInfoReq
//     * @return
//     */
//    @PostMapping ("/sceneStatistics")
//    public RespJSON sceneStatistics(@RequestBody(required = false) WorkOrderInfo workOrderInfoReq) {
//        List<OrderAlarmAssort> list = orderAlarmAssortService.getList(new OrderAlarmAssort());
//        List<OrderAlarmInfo> infoServiceList = orderAlarmInfoService.getList(new OrderAlarmInfo());
//        if(ObjectUtils.isEmpty(workOrderInfoReq)){
//            workOrderInfoReq=new WorkOrderInfo();
//        }
//        for (OrderAlarmAssort item : list) {
//            if(item.getLevel()==1){
//                workOrderInfoReq.setMainTypeId(item.getId());
//            }else {
//                workOrderInfoReq.setMinorTypeId(item.getId());
//            }
//            item.setCount(workOrderInfoService.getCount(workOrderInfoReq));
//            workOrderInfoReq.setMinorTypeId(null);
//            workOrderInfoReq.setMainTypeId(null);
//        }
//        for (OrderAlarmInfo orderAlarmInfo : infoServiceList) {
//            workOrderInfoReq.setBusinessScenario(orderAlarmInfo.getCallBackName());
//            int count = workOrderInfoService.getCount(workOrderInfoReq);
//            OrderAlarmAssort orderAlarmAssort = new OrderAlarmAssort();
//            orderAlarmAssort.setCount(count);
//            orderAlarmAssort.setName(orderAlarmInfo.getName());
//            orderAlarmAssort.setParentId(orderAlarmInfo.getMinorTypeId());
//            orderAlarmAssort.setLevel(3);
//            list.add(orderAlarmAssort);
//        }
//        return RespJSON.success(list);
//    }
//
//    /**
//     * 部门树
//     * @param sysDeptReq
//     * @return
//     */
//    @PostMapping("/getDeptPageTreeList")
//    public RespJSON getPageTreeList(@RequestBody SysDept sysDeptReq) {
//        WJAssert.notNull(sysDeptReq.getPageSize(), "分页参数不合法!");
//        WJAssert.notNull(sysDeptReq.getPageNo(), "分页参数不合法!");
////        sysDeptReq.setParentId("0");
//        int count = sysDeptService.getCount(sysDeptReq);
//        List<SysDept> list = new ArrayList<>();
//        if (count > 0) {
////            list = sysDeptService.getPageTreeList(sysDeptReq);
//        }
//        PageResult result = new PageResult(sysDeptReq.getPageNo(), sysDeptReq.getPageSize(), count, list);
//        return RespJSON.success(result);
//    }
//    /**
//     * 部门树
//     * @param sysDeptReq
//     * @return
//     */
//    @PostMapping("/getDeptPageList")
//    public RespJSON getPageList(@RequestBody SysDept sysDeptReq) {
//        WJAssert.notNull(sysDeptReq.getPageSize(), "分页参数不合法!");
//        WJAssert.notNull(sysDeptReq.getPageNo(), "分页参数不合法!");
//        int count = sysDeptService.getCount(sysDeptReq);
//        List<SysDept> list = new ArrayList<>();
//        if (count > 0) {
//            list = sysDeptService.getPageList(sysDeptReq);
//        }
//        PageResult result = new PageResult(sysDeptReq.getPageNo(), sysDeptReq.getPageSize(), count, list);
//        return RespJSON.success(result);
//    }
//
//    /**
//     * callbackEVS
//     * @return
//     */
//    @PostMapping ("/callbackEVS")
//    public RespJSON numberOfAlarms(@RequestBody EvsRequestVO vo) {
//        HttpMethodName httpMethod=null;
//        if(vo.getHttpMethod().equals("GET")){
//            httpMethod=HttpMethodName.GET;
//        }
//        if(vo.getHttpMethod().equals("PUT")){
//            httpMethod=HttpMethodName.PUT;
//        }
//        if(vo.getHttpMethod().equals("POST")){
//            httpMethod=HttpMethodName.POST;
//        }
//        if(vo.getHttpMethod().equals("DELETE")){
//            httpMethod=HttpMethodName.DELETE;
//        }
//        return RespJSON.success(baiduEVSRequestUtil.evsRequest(
//                new BaiduRequestSignatureHaders(BaiduEVSConstant.EVS_BASE_HOST),vo.getParams(),
//                BaiduEVSConstant.EVS_BASE_URL+vo.getUri(), httpMethod));
//    }
////    /**
////     * 场站告警数量 摄像头分布
////     * @param sysDeptCamera
////     * @return
////     */
////    @PostMapping ("/alarmsOrCamera")
////    public RespJSON alarmsOrCamera(@RequestBody SysDeptCamera sysDeptCamera) {
////        WJAssert.notNull(sysDeptCamera.getDepId(), "参数不合法!");
////        WorkOrderInfo where = new WorkOrderInfo();
////        where.setDeptId(sysDeptCamera.getDepId());
////        int count = workOrderInfoService.getCount(where);
////        SysDeptCamera camera = new SysDeptCamera();
////        camera.setDepId(sysDeptCamera.getDepId());
////        List<SysDeptCamera> list = sysDeptCameraService.getList(camera).stream().peek(item->{
////            WorkOrderInfo workOrderInfo = new WorkOrderInfo();
////            workOrderInfo.setOrderStatus(EnumWorkOrderStatus.AGENCY.getCode());
////            workOrderInfo.setDeptId(item.getDepId());
////            workOrderInfo.setPageSize(1);
////            workOrderInfo.setPageNo(1);
////            workOrderInfo.setDeviceId(item.getDeviceId());
////            workOrderInfo.setCreateTimeStart(sysDeptCamera.getCreateTimeStart());
////            workOrderInfo.setUpdateTimeEnd(sysDeptCamera.getUpdateTimeEnd());
////            List<WorkOrderInfo> pageList = workOrderInfoService.getPageList(workOrderInfo);
////            WorkOrderInfo orderWhere = new WorkOrderInfo();
////            orderWhere.setCreateTimeStart(sysDeptCamera.getCreateTimeStart());
////            orderWhere.setUpdateTimeEnd(sysDeptCamera.getUpdateTimeEnd());
////            orderWhere.setDeviceId(item.getDeviceId());
////            int workOrderCount = workOrderInfoService.getCount(orderWhere);
////            item.setAlarmsCount((long) workOrderCount);
////            if(!CollectionUtils.isEmpty(pageList)){
////                pageList.get(0).setImageUrl(imagePrefix+pageList.get(0).getImageUrl());
////            }
////            item.setWorkOrderInfo(CollectionUtils.isEmpty(pageList)?null:pageList.get(0));
////        }).collect(Collectors.toList());
////        HashMap<String, String> params = new HashMap<>();
////        params.put("protocol","flv");
////        list.parallelStream().forEach(item ->{
////            if(item.getOnline()){
////                if(item.getSpaceType()==1){
////                    HttpResult httpResult = baiduEVSRequestUtil.evsRequest(
////                            new BaiduRequestSignatureHaders(BaiduEVSConstant.EVS_BASE_HOST), params,
////                            BaiduEVSConstant.EVS_BASE_URL + "/v1/device/channel/"+item.getDeviceId()+"/signedUrls", HttpMethodName.GET);
////                    item.setUrls(httpResult.getBody());
////                }else {
////                    HttpResult httpResult = baiduEVSRequestUtil.evsRequest(
////                            new BaiduRequestSignatureHaders(BaiduEVSConstant.EVS_BASE_HOST), params,
////                            BaiduEVSConstant.EVS_BASE_URL + "/v1/device/"+item.getDeviceId()+"/signedUrl", HttpMethodName.GET);
////                    item.setUrls(httpResult.getBody());
////                }
////            }
////        });
////        return RespJSON.success(new AlarmsOrCameraVO(count,list));
////    }
//
//
////    /**
////     * 调度中心下有多少个场站和营业厅，每个营业厅又有多少个报警
////     * @param sysDept notice
////     * @return RespJSON
////     */
////    @PostMapping("/centerAlarms")
////    public RespJSON numberOfSubordinateAlarms(@RequestBody SysDept sysDept) {
////        //如果区域不为空，则按区域查询
////        if(!StringUtils.isEmpty(sysDept.getArea())){
////            List<SysDept> list = sysDeptService.getList(sysDept);
////            ArrayList<CenterAlarmsVO> centerAlarmsVOS = new ArrayList<>();
////            for (SysDept dept : list) {
////                WorkOrderInfo orderWhere = new WorkOrderInfo();
//////                orderWhere.setCreateTimeStart(sysDept.getCreateTimeStart());
////                orderWhere.setUpdateTimeEnd(sysDept.getUpdateTimeEnd());
////                orderWhere.setDeptId(dept.getId());
//////                CenterAlarmsVO vo=new CenterAlarmsVO(dept.getId(),dept.getName(),dept.getPoiId(),Long.valueOf(workOrderInfoService.getCount(orderWhere)));
//////                centerAlarmsVOS.add(vo);
////            }
////            return RespJSON.success(centerAlarmsVOS);
////        }
////        return RespJSON.success(getChild(sysDeptService.getList(new SysDept()),sysDept.getId()).stream().peek(item->{
////            WorkOrderInfo orderWhere = new WorkOrderInfo();
//////            orderWhere.setCreateTimeStart(sysDept.getCreateTimeStart());
////            orderWhere.setUpdateTimeEnd(sysDept.getUpdateTimeEnd());
////            orderWhere.setDeptId(item.getId());
////            int workOrderCount = workOrderInfoService.getCount(orderWhere);
////            item.setAlarmsCount((long) workOrderCount);
////        }).collect(Collectors.toList()));
////    }
////
////    private ArrayList<CenterAlarmsVO> getChild(List<SysDept> list,Long id){
////        ArrayList<SysDept> sysDepts = new ArrayList<>();
////        ArrayList<CenterAlarmsVO> childs = new ArrayList<>();
////        for (SysDept dept : list) {
////            if(Long.valueOf(dept.getParentId()).equals(id)){
////                sysDepts.add(dept);
////            }
////        }
////        for (SysDept dept : sysDepts) {
////            for (SysDept item : list) {
////                if(Long.valueOf(item.getParentId()).equals(dept.getId())){
//////                    childs.add(new CenterAlarmsVO(item.getId(),item.getName(),item.getPoiId(),item.getAlarmsCount()));
////                }
////            }
////        }
////        return childs;
////    }
//
////    /**
////     * 已接单工单
////     * @param ids
////     * @return RespJSON
////     */
////    @PostMapping("/receivedOrder")
////    public RespJSON receivedOrder(String ids) {
////        WJAssert.notNull(ids, "ID 不合法");
////        String[] split = ids.split(",");
////        ArrayList<Long> longs = new ArrayList<>();
////        for (String s : split) {
////            WorkOrderInfo orderInfo = workOrderInfoService.getOneById(Long.valueOf(s));
////            if(orderInfo!=null&&orderInfo.getOrderStatus()!=0){
////                longs.add(orderInfo.getId());
////            }
////        }
////        return RespJSON.success(longs);
////    }
//
////    /**
////     * 催单
////     * @param notice notice
////     * @return RespJSON
////     */
////    @PostMapping("/reminders")
////    public RespJSON reminders(@RequestBody SysNotice notice) {
////        WJAssert.notNull(notice.getId(), "ID 不合法");
////        workOrderInfoService.reminders(notice.getId(), "大屏系统",-1L);
////        return RespJSON.success();
////    }
//
////    /**
////     * 业务概况
////     * @return
////     */
////    @PostMapping("/businessOverview")
////    public RespJSON businessOverview(@RequestBody SysDept sysDept){
////        BusinessOverbiewVO businessOverbiewVO = new BusinessOverbiewVO();
////        //如果区域不为空，则按区域查询
////        if(!StringUtils.isEmpty(sysDept.getArea())){
////            List<SysDept> list = sysDeptService.getList(sysDept);
////            extractedArea(businessOverbiewVO,list,sysDept.getArea());
////            return RespJSON.success(businessOverbiewVO);
////        }
////        List<SysDept> list = sysDeptService.getList(new SysDept());
////        //如果没有参数 查询所有部门业务概况
////        if(ObjectUtils.isEmpty(sysDept.getId())){
////            extracted(businessOverbiewVO, list,false,null);
////            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.ALL_AI_NUM);
////            SysDeptCamera sysDeptCameraEq = new SysDeptCamera();
////            sysDeptCameraEq.setDepType(EnumDeptType.DEPT_BUSINESS_HALL.getCode());
////            sysDeptCameraEq.setOnline(true);
////            sysDeptCameraEq.setIsAi(true);
////            businessOverbiewVO.setOfficeAiOnLineCameraNum(Long.valueOf(sysDeptCameraService.getCount(sysDeptCameraEq)));
////            sysDeptCameraEq.setDepType(EnumDeptType.DEPT_STATIONS.getCode());
////            businessOverbiewVO.setSiteAiOnLineCameraNum(Long.valueOf(sysDeptCameraService.getCount(sysDeptCameraEq)));
////            businessOverbiewVO.setAiNum(officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
////            Object o = redisTemplate.opsForValue().get(RedisKeys.AI_NUMS);
////            businessOverbiewVO.setAiCameraRoadNum(o==null?0:Integer.valueOf(o.toString()));
////            return RespJSON.success(businessOverbiewVO);
////        }
////        SysDept dept = sysDeptService.getOneById(sysDept.getId());
////        if(ObjectUtils.isEmpty(dept)){
////            return RespJSON.success();
////        }
////        //如果是调度中心
////        if(dept.getDeptType().equals(EnumDeptType.DEPT_DISPATCH_CENTER.getCode())){
////            extracted(businessOverbiewVO, list,true,dept.getId());
////            Object aiNum = redisTemplate.opsForValue().get(RedisKeys.DISPATCH_AI_NUM+":"+dept.getId());
////            businessOverbiewVO.setAiNum(aiNum==null?0L:Long.valueOf(aiNum.toString()));
////            businessOverbiewVO.setAiNum(businessOverbiewVO.getOfficeAiNum()+ businessOverbiewVO.getSiteAiNum());
////            return RespJSON.success(businessOverbiewVO);
////        }
////        //如果是营业厅
////        if(dept.getDeptType().equals(EnumDeptType.DEPT_BUSINESS_HALL.getCode())){
////            businessOverbiewVO.setOfficeCameraNum(Long.valueOf(dept.getCameraCount()==null?0L:dept.getCameraCount()));
////            businessOverbiewVO.setOfficeAiCameraNum(Long.valueOf(dept.getAiCameraCount()==null?0L:dept.getAiCameraCount()));
////            return getRespJSON(businessOverbiewVO, dept);
////        }
////        //如果是场站
////        if(dept.getDeptType().equals(EnumDeptType.DEPT_STATIONS.getCode())){
////            businessOverbiewVO.setSiteCameraNum(Long.valueOf(dept.getCameraCount()==null?0L:dept.getCameraCount()));
////            businessOverbiewVO.setSiteAiCameraNum(Long.valueOf(dept.getAiCameraCount()==null?0L:dept.getAiCameraCount()));
////            return getRespJSON(businessOverbiewVO, dept);
////        }
////        return RespJSON.success();
////    }
//
//    @NotNull
//    private RespJSON getRespJSON(BusinessOverbiewVO businessOverbiewVO, SysDept dept) {
//        SysDeptCamera sysDeptCamera = new SysDeptCamera();
//        sysDeptCamera.setDepId(dept.getId());
//        List<SysDeptCamera> deptCameras = sysDeptCameraService.getList(sysDeptCamera);
//        Long offlineNum=0L;
//        Long onlineNum=0L;
//        for (SysDeptCamera deptCamera : deptCameras) {
//            if(deptCamera.getOnline()){
//                onlineNum=onlineNum+1;
//            }else {
//                offlineNum=offlineNum+1;
//            }
//        }
//        businessOverbiewVO.setOfflineCameraNum(offlineNum);
//        businessOverbiewVO.setOnlineCameraNum(onlineNum);
//        return RespJSON.success(businessOverbiewVO);
//    }
//    private void extractedArea(BusinessOverbiewVO businessOverbiewVO, List<SysDept> list,String area) {
//        List<SysDept> sites = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_STATIONS.getCode())).collect(Collectors.toList());
//        List<SysDept> offices = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_BUSINESS_HALL.getCode())).collect(Collectors.toList());
//        Long officeCamerNum=0L;
//        Long officeAiCamerNum=0L;
//        Long siteCamerNum=0L;
//        Long siteAiCamerNum=0L;
//        //营业厅数量
//        businessOverbiewVO.setOfficeNum(Long.valueOf(offices.size()));
//        for (SysDept office : offices) {
//            officeCamerNum=officeCamerNum+(office.getCameraCount()==null?0L:office.getCameraCount());
//            officeAiCamerNum=officeAiCamerNum+(office.getAiCameraCount()==null?0L:office.getAiCameraCount());
//        }
//        //营业厅摄像头数量
//        businessOverbiewVO.setOfficeCameraNum(officeCamerNum);
//        //营业厅AI摄像头数量
//        businessOverbiewVO.setOfficeAiCameraNum(officeAiCamerNum);
//        //场站数量
//        businessOverbiewVO.setSiteNum(Long.valueOf(sites.size()));
//        for (SysDept site : sites) {
//            siteCamerNum=siteCamerNum+(site.getCameraCount()==null?0L:site.getCameraCount());
//            siteAiCamerNum=siteAiCamerNum+(site.getAiCameraCount()==null?0L:site.getAiCameraCount());
//        }
//        //场站AI摄像头数量
//        businessOverbiewVO.setSiteAiCameraNum(siteAiCamerNum);
//        //场站摄像头数量
//        businessOverbiewVO.setSiteCameraNum(siteCamerNum);
//        Long siteAinums=0l;
//        Long officeAinums=0l;
//        if(area.equals("四川")){
//            Object aiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SC);
//            businessOverbiewVO.setAiNum(aiNum==null?0L:Long.valueOf(aiNum.toString()));
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SC_SITE);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SC_BUSINESS);
//            businessOverbiewVO.setOfficeAiNum(officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }
//        if(area.equals("顺平")){
//            Object aiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SP);
//            businessOverbiewVO.setAiNum(aiNum==null?0L:Long.valueOf(aiNum.toString()));
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SP_SITE);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_SP_BUSINESS);
//            businessOverbiewVO.setOfficeAiNum(officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }
//        if(area.equals("景德镇")){
//            Object aiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_JDZ);
//            businessOverbiewVO.setAiNum(aiNum==null?0L:Long.valueOf(aiNum.toString()));
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_JDZ_SITE);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_JDZ_BUSINESS);
//            businessOverbiewVO.setOfficeAiNum(officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }
//        if(area.equals("安徽")){
//            Object aiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_AH);
//            businessOverbiewVO.setAiNum(aiNum==null?0L:Long.valueOf(aiNum.toString()));
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_AH_SITE);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.AREA_AI_NUM_AH_BUSINESS);
//            businessOverbiewVO.setOfficeAiNum(officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }
//    }
//    private void extracted(BusinessOverbiewVO businessOverbiewVO, List<SysDept> list, Boolean isDispatch,Long dispatchId) {
//        List<SysDept> sites ;
//        List<SysDept> offices;
//        if(!isDispatch){
//            sites = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_STATIONS.getCode())).collect(Collectors.toList());
//            offices = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_BUSINESS_HALL.getCode())).collect(Collectors.toList());
//        }else {
//            sites = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_STATIONS.getCode())&&item.getDispatchId().equals(dispatchId)).collect(Collectors.toList());
//            offices = list.stream().filter(item -> item.getDeptType().equals(EnumDeptType.DEPT_BUSINESS_HALL.getCode())&&item.getDispatchId().equals(dispatchId)).collect(Collectors.toList());
//        }
//        Long officeCamerNum=0L;
//        Long officeAiCamerNum=0L;
//        Long siteCamerNum=0L;
//        Long siteAiCamerNum=0L;
//        //营业厅数量
//        businessOverbiewVO.setOfficeNum(Long.valueOf(offices.size()));
//        for (SysDept office : offices) {
//            officeCamerNum=officeCamerNum+(office.getCameraCount()==null?0L:office.getCameraCount());
//            officeAiCamerNum=officeAiCamerNum+(office.getAiCameraCount()==null?0L:office.getAiCameraCount());
//        }
//        //营业厅摄像头数量
//        businessOverbiewVO.setOfficeCameraNum(officeCamerNum);
//        //营业厅AI摄像头数量
//        businessOverbiewVO.setOfficeAiCameraNum(officeAiCamerNum);
//        //场站数量
//        businessOverbiewVO.setSiteNum(Long.valueOf(sites.size()));
//        for (SysDept site : sites) {
//            siteCamerNum=siteCamerNum+(site.getCameraCount()==null?0L:site.getCameraCount());
//            siteAiCamerNum=siteAiCamerNum+(site.getAiCameraCount()==null?0L:site.getAiCameraCount());
//        }
//        //场站AI摄像头数量
//        businessOverbiewVO.setSiteAiCameraNum(siteAiCamerNum);
//        //场站摄像头数量
//        businessOverbiewVO.setSiteCameraNum(siteCamerNum);
//        if(isDispatch){
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.DISPATCH_STATIONS_AI_NUM + ":" + dispatchId);
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.DISPATCH_OFFICES_AI_NUM + ":" + dispatchId);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            businessOverbiewVO.setOfficeAiNum( officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }else {
//            //总数场站AI算法种类
//            Object siteAiNum = redisTemplate.opsForValue().get(RedisKeys.STATIONS_NUM);
//            businessOverbiewVO.setSiteAiNum(siteAiNum==null?0L:Long.valueOf(siteAiNum.toString()));
//            //总数营业厅AI算法种类
//            Object officeAiNum = redisTemplate.opsForValue().get(RedisKeys.OFFICES_NUM);
//            businessOverbiewVO.setOfficeAiNum( officeAiNum==null?0L:Long.valueOf(officeAiNum.toString()));
//        }
//    }
//
//
//}
